#include <iostream>
#include <array>
using namespace std;

void xuanze() {
    array<int,5> arr= {400,100,600,285,350};
    int max = 0;
    for (int i=0;i<arr.size();i++) {
        if (arr[max]<arr[i]) {
            max = i;
        }
    }
    cout<<"数组最大值是第："<<max<<"项，"<<"数值为："<<arr[max]<<endl;

    array<int,5> arr2={};
    for (int i=0;i<arr.size();i++) {
        int min = i;
        for (int j = i+1;j<arr.size();j++) {
            if (arr[j]<arr[min]) {
                min = j;
            }
        }
        int temp = arr[i];
        arr[i] = arr[min];
        arr[min] = temp;
    }

    for (int i = 0;i<arr.size();i++) {
        cout<<arr[i]<<endl;
    }
}
